package com.leyou.item.service.service;

import com.leyou.common.bean.Result;
import com.leyou.item.inter.dto.CategoryUpdateDTO;
import com.leyou.item.inter.pojo.Category;

import java.util.List;

/**
 * @author zqq
 * @ClassName CategoryService
 * @Description
 * @date 2020/3/3-15:46
 */
public interface CategoryService {

    /**
     * @Title: queryCategoriesByPid
     * @Description: 根据parentId查询子类目
     * @author: zqq
     * @param pid parentId
     * @return: java.util.List<com.leyou.item.inter.pojo.Category>
     * @createTime: 2020-03-05 11:22
     * @version: v.1.0
     */
    Result<List<Category>> queryCategoriesByPid(Long pid);


    /**
     * @Title: queryByBrandId
     * @Description: 根据品牌id查询商品分类
     * @author: zqq
     * @param bid 品牌id
     * @return: com.leyou.common.bean.Result<java.util.List<com.leyou.item.inter.pojo.Category>>
     * @createTime: 2020-03-06 18:58
     * @version: v.1.0
     */
    Result<List<Category>> queryByBrandId(Long bid);

    /**
     * @Title: queryNamesByIds
     * @Description: 根据类目id集合，按照ids的顺序查询分类名
     * @author: zqq
     * @param ids 分类集合
     * @return: com.leyou.common.bean.Result<java.util.List<java.lang.String>>
     * @createTime: 2020-03-07 10:22
     * @version: v.1.0
     */
    Result<List<String>> queryNamesByIds(List<Long> ids);

    /**
     * @Title: queryListByPid
     * @Description: 按层级查询所有类目信息
     * @author: zqq
     * @return: com.leyou.common.bean.Result<java.util.List<com.leyou.item.inter.pojo.Category>>
     * @createTime: 2020-03-08 10:43
     * @version: v.1.0
     */
    Result<List<Category>> queryListByCid();

    /**
     * @Title: queryAllByCid3
     * @Description: 根据3级分类id，查询1~3级的分类
     * @author: zqq
     * @param id 3级分类id
     * @return: com.leyou.common.bean.Result<java.util.List<com.leyou.item.inter.pojo.Category>>
     * @createTime: 2020-03-09 10:40
     * @version: v.1.0
     */
    Result<List<Category>> queryAllByCid3(Long id);

    /**
     * @Title: updateCategory
     * @Description: 新增或编辑类目
     * @author: zqq
     * @param dto 参数类
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-03-14 16:46
     * @version: v.1.0
     */
    Result updateCategory(CategoryUpdateDTO dto);

    /**
     * @Title: deleteCategory
     * @Description: 删除类目
     * @author: zqq
     * @param id 类目id
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-03-14 17:31
     * @version: v.1.0
     */
    Result deleteCategory(Long id);

    /**
     * @Title: queryCategoryById
     * @Description: 根据主键查询
     * @author: zqq
     * @param id
     * @return: com.leyou.common.bean.Result<com.leyou.item.inter.pojo.Category>
     * @createTime: 2020-04-08 15:33
     * @version: v.1.0
     */
    Result<Category> queryCategoryById(Long id);

}
